<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport" />
    <meta content="yes" name=" apple-mobile-web-app-capable" />
    <!-- 隐藏状态栏  -->
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <!-- <title>待付款的订单</title> -->
    <link rel="stylesheet" href="css/details.css">
    <link rel="stylesheet" href="css/common.css">
</head>

<body style="background: #444549;">
    <header>
        <div class="wrapper clearfix">
            <div class="login_fl fl">
                <a href="javascript:history.back();" class="login_icon"><img src="img/srh_icon.png" alt=""></a>
            </div>
            <h1>待付款的订单</h1>
        </div>
    </header>
    <section class="qr">
        <div class="qr-content">
            <div class="qr-wrapper">
                <div class="header">
                    <p>微信扫码支付</p>
                    <p class="price"></p>
                </div>
                <div class="qr-pic">
                    <img alt="" id="qr" />
                </div>
                <div class="footer">
                    <p>长按图片识别二维码付款</p>
                </div>
            </div>
        </div>
    </section>
    <div class="payafter-btn">
        <p> 
            <button onclick="lnkBtn()">支付成功请点击此按钮</button>
        </p> 
    </div>
    <div class="copyright">
        <p>去嗨科技提供技术支持</p>
    </div>
</body>
<span style="display:none;"><script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_1255764485'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s95.cnzz.com/z_stat.php%3Fid%3D1255764485%26show%3Dpic1' type='text/javascript'%3E%3C/script%3E"));</script></span>
<!-- JS begin -->
<script src="js/jquery-1.11.2.min.js"></script>
<script src="js/angular.min.js"></script>
<script type="text/javascript" src="js/constants.js"></script>
<script src="js/common.js"></script>
<script>
//订单号
var orderNum = getParameterByName('orderNum');
var price = getParameterByName('price');

$('.price').html('¥' + price);

$.ajax({
    type: 'POST',
    dataType: 'json',
    url: server_host + '/h5wx/callwxpay_codeUrl.do?orderNum=' + orderNum,
    success: function(data) {
        if (typeof(data.codeUrl) != 'undefined') {
            $('#qr').attr('src', data.codeUrl);
        }
    }
});


function lnkBtn(){ 
    $.ajax({
        type: 'GET',
        dataType: 'json',
        url: server_host + '/userweb/order/checkCashState.do?orderNum=' + orderNum,
        success: function(data) {
            console.log(data);
            if(data.code == 0){
                location.href = 'ok-pay.html?orderNum=' + orderNum;
            }else{
                alert("您尚未支付订单，请识别二维码进行付款");
            }
        }
    });
    
}
</script>
<!-- JS end -->
<script>
    _maq.push(['_setMaq', 'qr']);
</script>
</html>
